home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / BSCRIPTS.CST / 00083_Script_CDmenu < prev    next >
Text File  |  1999-04-25  |  3KB  |  104 lines

  1. -- ⌐ 1998 @radical.media, inc. & Concurrent New Media Group, L.L.C.
  2. -- Developed for Bombardier, Inc.
  3. --
  4. -- All programming developed by: 
  5. -- Robert Fabricant, Valerie Valoueva, Ossi Shaked, 
  6. -- Henry Sauvageot, Chris Howell & Chris Girand
  7. --
  8. -- Use of this code by parties other than @radical.media, inc. or their
  9. --agents 
  10. -- without the express written consent of @radical.media, inc. AND Concurrent 
  11. -- New Media Group, L.L.C. is strictly prohibited.
  12. ------------------------------------------------------
  13. --This script changes two images if either one is rolled over and takes you to a certain frame when either one is clicked. The  conventions for this script to work are:
  14. --1) rollover images names are formed by adding "-hil" to the names of the original images
  15. --2)Name of one of the images should contain "field"
  16. --3)Images have to be located in the adjacent channels in the score
  17.  
  18. property mySprite, NeutralName, HiliteName, selected,¼
  19.          linkedSprite, linkedNeutralName, linkedHiliteName
  20.  
  21. on new me
  22.   set mySprite = the spriteNum of me
  23.   set NeutralName = getNeutralName(me, mySprite)
  24.   set HiliteName = NeutralName&"-hil"
  25.   set linkedSprite = getLinkedSprite (me, NeutralName)
  26.   set linkedNeutralName = getNeutralName (me,linkedSprite)
  27.   set linkedHiliteName = linkedNeutralName&"-hil"
  28. end
  29.  
  30. on getLinkedSprite me, NeutralName
  31.   if NeutralName contains "field" then
  32.     set value = mySprite-1
  33.   else
  34.     set value =mySprite+1
  35.   end if
  36.   return value
  37. end 
  38.  
  39.  
  40. on mouseEnter me
  41.   set the member of sprite mySprite = member  HiliteName
  42.   set the member of sprite linkedSprite = member  linkedHiliteName
  43.   updatestage
  44.   puppetsound 3, "newroll"
  45. end
  46.  
  47. on mouseLeave me
  48.   set the member of sprite mySprite = member  NeutralName
  49.   set the member of sprite linkedSprite = member  linkedNeutralName
  50. end
  51.  
  52. on mouseUp me
  53.   go to label( "detail"& getDetailNum (me))
  54.   puppetsound 3, "newclick"
  55. end
  56.  
  57. on getDetailNum me
  58.   set myString = ""
  59.   repeat with i = 1 to the Number of Chars in NeutralName
  60.     set value = integer(char i of NeutralName)
  61.     if not(voidP(value)) then
  62.       set myString = myString&string(value)
  63.     else
  64.       exit repeat
  65.     end if
  66.   end repeat
  67.   
  68.   return myString
  69.   
  70. end
  71.  
  72.  
  73.  
  74.  
  75. on getNeutralName me,SpriteNum
  76.   
  77.   set aMember = the member of sprite spriteNum
  78.   set Name = the name of member aMember
  79.   if Name contains "-" then
  80.     repeat with i = the Number of Chars of Name down to 1
  81.       if char i of Name <> "-" then 
  82.         delete char i of Name
  83.       else
  84.         delete char i of Name
  85.         exit repeat
  86.       end if
  87.     end repeat
  88.   end if
  89.   
  90.   return Name
  91.   
  92. end
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. on CDMenuPuppetsOff me
  102.   puppetsprite mySprite, false
  103. end
  104.